package com.bw.shop2208a.utils

import com.bw.shop2208a.entity.*
import io.reactivex.Observable
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Path
import retrofit2.http.Query

/**
 * 接口  网络请求的所有接口
 */
interface Apiservice {
    @POST(Constant.LOGIN_URL)
    suspend fun login(@Body loginParam: LoginParam): UserResult

    @POST(Constant.REGISTER_URL)
    suspend fun register(@Body registerParam: RegisterParam): UserResult

    @GET(Constant.GOODS_URL)
    suspend fun getGoods(
        @Query("category_id") category_id: Int,
        @Query("currentPage") currentPage: Int,
        @Query("pageSize") pageSize: Int
    ): GoodsEntity

    @GET(Constant.GOODS_TYPE_URL)
    suspend fun getGoodsType(): GoodsTypeEntity

    @GET(Constant.BANNER_URL)
    suspend fun getBanner(): BannerEntity

    @GET(Constant.DETAIL_URL)
    suspend fun getDetail(@Query("goods_id")goods_id:Int):DetailEntity

    @POST(Constant.ADDCAR_URL)
    suspend fun addCar(@Body addcarParam: AddcarParam):AddCarResult

    @GET(Constant.GETCAR_URL)
    suspend fun getCar():GetCarEntity

    @POST(Constant.DELETECAR_URL)
    suspend fun deleteCar(@Body deleteCarParam: DeleteCarParam):DeleteResult
}